package cn.coldleaf.wiki.services;

import cn.coldleaf.wiki.pojo.dto.FileUploadDto;
import cn.coldleaf.wiki.pojo.vo.FileVo;
import cn.coldleaf.wiki.pojo.vo.UploadVo;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 流处理Service
 * @datetime 2023-10-17 14:59:57
 * @user cold
 **/
public interface StreamService {

    /**
     * 获取图片
     * @param name 图片名称
     * @datetime 2023-10-17 15:03:38
     * @user cold
     **/
    public void file(HttpServletResponse response,Long userId,String type,String name);

    /**
     * 获取验证码
     * @datetime 2023-10-17 15:05:13
     * @user cold
     **/
    public void captcha(HttpServletResponse response);

    /**
     * 上传文件
     * @datetime 2023-10-19 10:26:27
     * @user cold
     **/
    public UploadVo upload(FileUploadDto dto);

    /**
     * 下载文件
     * @param name 文件名
     * @datetime 2023-10-17 15:05:47
     * @user cold
     **/
    public byte[] download(Long userId,String name);

    /**
     * 删除指定文件
     * @datetime 2023-10-26 16:45:36
     * @user cold
     **/
    public int removeFile(String type,String realName);

    /**
     * 获取文档资源列表
     * @datetime 2023-10-26 18:43:27
     * @user cold
     **/
    public List<FileVo> getByDoc(Long docId);
}
